Log temp-dir contents when test teardown fails to delete it#368
Open
chrisdp wants to merge 1 commit into
Open
Conversation
The shared .tmp teardown intermittently fails on Windows with ENOTEMPTY when an earlier test leaves a file/handle open. Wrap the remove/empty calls so that on failure we log every path still present under .tmp (and which teardown hit it), then re-throw. Diagnostic only; no production changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Diagnostic for the intermittent Windows CI failure where a test's
afterEachfails to delete the shared.tmpdir:The victim spec varies (LocationManager, BreakpointManager, ...) and it only happens on Windows, which means an earlier test leaves a file/handle open in the shared
.tmpand whichever teardown runs while it's held is the one that throws. We can't tell which leftovers are locking it from the failure alone.This wraps the
.tmpremove/empty calls in the global teardown and the specs that share the dir with a helper that, on failure, logs every path still present under.tmp(and which teardown hit it), then re-throws. It diagnoses the failure without masking it.